<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> 
    <title>MAC结合LINUX进行Jmeter进行java代码压力测试 - 天地维杰网</title>
    <meta name="keywords" content="系统架构,shutdown,不与天斗,Domino,博客,程序员,架构师,笔记,技术,分享,java,Redis">
    
    <meta property="og:title" content="MAC结合LINUX进行Jmeter进行java代码压力测试">
    <meta property="og:site_name" content="天地维杰网">
    <meta property="og:image" content="/img/author.jpg"> 
    <meta name="title" content="MAC结合LINUX进行Jmeter进行java代码压力测试 - 天地维杰网" />
    <meta name="description" content="MAC结合LINUX进行Jmeter进行java代码压力测试" />
     
    <link rel="shortcut icon" href="http://www.shutdown.cn/img/favicon.ico" />
    <link rel="apple-touch-icon" href="http://www.shutdown.cn/img/apple-touch-icon.png" />
    <link rel="apple-touch-icon-precomposed" href="http://www.shutdown.cn/img/apple-touch-icon.png" />
    <link href="http://www.shutdown.cn/js/vendor/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />
    <link href="http://www.shutdown.cn/js/vendor/fancybox/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />
    <link href="http://www.shutdown.cn/css/main.css" rel="stylesheet" type="text/css" />
    <link href="http://www.shutdown.cn/css/syntax.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Pisces',
    sidebar: {"position":"left","display":"post"},
     fancybox: true, 
    motion: true
  };
</script>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-7826003325059020" crossorigin="anonymous"></script>
</head>
<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">
<div class="container one-collumn sidebar-position-left page-home  ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"> <div class="site-meta  custom-logo ">

  <div class="custom-logo-site-title">
    <a href="http://www.shutdown.cn"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">天地维杰网</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">人如秋鸿来有信，事若春梦了无痕</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
    <ul id="menu" class="menu">
      
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />首页
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/redis/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-battery-full"></i> <br />Redis
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/java/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-coffee"></i> <br />java
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/linux/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-linux"></i> <br />linux
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/daily/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-bug"></i> <br />日常问题
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/spring/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-child"></i> <br />Spring和Springboot
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/mac/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-fire"></i> <br />Mac相关
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/middleware/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-gavel"></i> <br />中间件
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/jiagou/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-rocket"></i> <br />架构
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/python/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-ship"></i> <br />python
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/front/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-bolt"></i> <br />前端
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/jvm/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-balance-scale"></i> <br />jvm
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/c/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-battery-empty"></i> <br />c语言
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/web3/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-web3"></i> <br />web3
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/post/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />归档
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/about/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />关于
          </a>
        </li>
      
      <li class="menu-item menu-item-search">
        <a href="javascript:;" class="popup-trigger"> <i class="menu-item-icon fa fa-search fa-fw"></i> <br /> 搜索</a>
      </li>
    </ul>
    <div class="site-search">
      <div class="popup">
 <span class="search-icon fa fa-search"></span>
 <input type="text" id="local-search-input">
 <div id="local-search-result"></div>
 <span class="popup-btn-close">close</span>
</div>

    </div>
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            
<section id="posts" class="posts-expand">
  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <header class="post-header">
      <h1 class="post-title" itemprop="name headline">
        <a class="post-title-link" href="http://www.shutdown.cn/post/mac-linux-jmeter-java-stress-testing/" itemprop="url">
        MAC结合LINUX进行Jmeter进行java代码压力测试
        </a>
      </h1>
      <div class="post-meta">
      <span class="post-time">
<span class="post-meta-item-icon">
    <i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">时间：</span>
<time itemprop="dateCreated" datetime="2016-03-22T13:04:35+08:00" content="2022-08-22">
    2022-08-22
</time>
</span> 
      

  <span class="post-category" >
  &nbsp; | &nbsp;
  <span class="post-meta-item-icon">
    <i class="fa fa-folder-o"></i>
  </span>
  <span class="post-meta-item-text">分类：</span>
  
    <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
      <a href="http://www.shutdown.cn/categories/java" itemprop="url" rel="index">
        <span itemprop="name">java</span>
      </a>
      &nbsp; 
    </span>
  
    <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
      <a href="http://www.shutdown.cn/categories/linux" itemprop="url" rel="index">
        <span itemprop="name">linux</span>
      </a>
      &nbsp; 
    </span>
  
</span>


      
 <span>
&nbsp; | &nbsp;
<span class="post-meta-item-icon">
    <i class="fa fa-eye"></i>
</span>
<span class="post-meta-item-text">原创</span>
</span>

       <span>
&nbsp; | &nbsp;
<span class="post-meta-item-icon">
    <i class="fa fa-eye"></i>
</span>
<span class="post-meta-item-text">阅读：</span>
<span class="leancloud-visitors-count">1970 字 ~4分钟</span>
</span>
      </div>
    </header>
    <div class="post-body" itemprop="articleBody">
    

    

<h2 id="一-环境准备">一、环境准备</h2>

<p><strong>下载jdk包</strong></p>

<p>地址：<a href="https://www.oracle.com/java/technologies/downloads/#java8">https://www.oracle.com/java/technologies/downloads/#java8</a></p>

<p>centos 下载 <code>x64 Compressed Archive</code>版本</p>

<div  align="center"><img src="https://wejack639.oss-cn-beijing.aliyuncs.com/blogimages/img/20220712190908.png" width = 900 /> </div>

<p>创建 <code>/usr/local/java</code> 目录并将jdk压缩包解压到该目录下</p>

<p>在 <code>/etc/profile</code>文件中设置环境变量，它是是所有用户的共用的环境变量，在末尾添加如下配置：</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-fallback" data-lang="fallback">export JAVA_HOME=/usr/local/java/jdk1.8.0_181
export JRE_HOME=/usr/local/java/jdk1.8.0_181/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$PATH</code></pre></div>
<p><strong>下载jmeter运行包</strong></p>

<p>下载地址：<code>https://jmeter.apache.org/download_jmeter.cgi</code></p>

<p>将下载的包解压到centos服务器的<code>/app/cachecloud/jmeter</code>目录中，然后在/etc/profile目录中配置 JMETER有环境变量</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-fallback" data-lang="fallback">export JMETER=/app/cachecloud/jmeter
export CLASSPATH=$JMETER/lib/ext/ApacheJMeter_core.jar:$JMETER/lib/jorphan.jar:$JMETER/lib/logkit-2.0.jar:$CLASSPATH
export PATH=$JMETER/bin/:$PATH</code></pre></div>
<p>配置jmeter配置文件</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#ce5c00;font-weight:bold">[</span>root@migrate_7_59 bin<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># vi /app/cachecloud/jmeter/bin/jmeter.properties</span></code></pre></div>
<p><code>server.rmi.ssl.disable</code> 值改为false</p>

<p><code>remote_hosts=127.0.0.1</code> ，该值设置为slave机器地址，多slave用英文逗号隔开。</p>

<p>如果我只用当前机器做为Jmeter测试服务器， 配置为127.0.0.1，如果我想使用多台Jmeter测试服务器进行测试，则在后面配置slave机器地址和port即可，如<code>remote_hosts=127.0.0.1,10.4.7.58:1099</code>，port的值配置在<code>jmeter.properties</code>的<code>server_port</code>属性中。slave机器jmeter的server_port配置要与master机器jmeter的remote_hosts配置的地址和port相一致。</p>

<p><strong>环境变量生效</strong></p>

<p>修改保存后，运行source命令使改动生效。</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#204a87">source</span> /etc/profile</code></pre></div>
<h2 id="二-创建jmeter测试计划">二、创建jmeter测试计划</h2>

<p><strong>打包测试java代码</strong></p>

<p>我要测试的是java的sdk，想在jmeter中能够选取测试的类，首先要将需要测试的java代码打成jar包，然后拷贝到jmeter的lib/ext目录下。如果代码依赖了外部的包，则需要将外部包一同打包到测试java代码的jar包中。pom.xml的plugin配置代码如下:</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-xml" data-lang="xml"><span style="color:#204a87;font-weight:bold">&lt;plugin</span><span style="color:#204a87;font-weight:bold">&gt;</span>
  <span style="color:#204a87;font-weight:bold">&lt;groupId</span><span style="color:#204a87;font-weight:bold">&gt;</span>org.apache.maven.plugins<span style="color:#204a87;font-weight:bold">&lt;/groupId&gt;</span>
  <span style="color:#204a87;font-weight:bold">&lt;artifactId</span><span style="color:#204a87;font-weight:bold">&gt;</span>maven-assembly-plugin<span style="color:#204a87;font-weight:bold">&lt;/artifactId&gt;</span>
  <span style="color:#204a87;font-weight:bold">&lt;version</span><span style="color:#204a87;font-weight:bold">&gt;</span>3.0.0<span style="color:#204a87;font-weight:bold">&lt;/version&gt;</span>
  <span style="color:#204a87;font-weight:bold">&lt;configuration</span><span style="color:#204a87;font-weight:bold">&gt;</span>
    <span style="color:#204a87;font-weight:bold">&lt;archive</span><span style="color:#204a87;font-weight:bold">&gt;</span>
      <span style="color:#204a87;font-weight:bold">&lt;manifest</span><span style="color:#204a87;font-weight:bold">&gt;</span>
        <span style="color:#204a87;font-weight:bold">&lt;mainClass</span><span style="color:#204a87;font-weight:bold">&gt;</span><span style="color:#204a87;font-weight:bold">&lt;/mainClass&gt;</span>
      <span style="color:#204a87;font-weight:bold">&lt;/manifest&gt;</span>
    <span style="color:#204a87;font-weight:bold">&lt;/archive&gt;</span>
    <span style="color:#204a87;font-weight:bold">&lt;descriptorRefs</span><span style="color:#204a87;font-weight:bold">&gt;</span>
      <span style="color:#204a87;font-weight:bold">&lt;descriptorRef</span><span style="color:#204a87;font-weight:bold">&gt;</span>jar-with-dependencies<span style="color:#204a87;font-weight:bold">&lt;/descriptorRef&gt;</span>
    <span style="color:#204a87;font-weight:bold">&lt;/descriptorRefs&gt;</span>
  <span style="color:#204a87;font-weight:bold">&lt;/configuration&gt;</span>
  <span style="color:#204a87;font-weight:bold">&lt;executions</span><span style="color:#204a87;font-weight:bold">&gt;</span>
    <span style="color:#204a87;font-weight:bold">&lt;execution</span><span style="color:#204a87;font-weight:bold">&gt;</span>
      <span style="color:#204a87;font-weight:bold">&lt;id</span><span style="color:#204a87;font-weight:bold">&gt;</span>make-assembly<span style="color:#204a87;font-weight:bold">&lt;/id&gt;</span> <span style="color:#8f5902;font-style:italic">&lt;!--</span><span style="color:#8f5902;font-style:italic"> this is used for inheritance merges </span><span style="color:#8f5902;font-style:italic">--&gt;</span>
      <span style="color:#204a87;font-weight:bold">&lt;phase</span><span style="color:#204a87;font-weight:bold">&gt;</span>package<span style="color:#204a87;font-weight:bold">&lt;/phase&gt;</span> <span style="color:#8f5902;font-style:italic">&lt;!--</span><span style="color:#8f5902;font-style:italic"> 指定在打包节点执行jar包合并操作 </span><span style="color:#8f5902;font-style:italic">--&gt;</span>
      <span style="color:#204a87;font-weight:bold">&lt;goals</span><span style="color:#204a87;font-weight:bold">&gt;</span>
        <span style="color:#204a87;font-weight:bold">&lt;goal</span><span style="color:#204a87;font-weight:bold">&gt;</span>single<span style="color:#204a87;font-weight:bold">&lt;/goal&gt;</span>
      <span style="color:#204a87;font-weight:bold">&lt;/goals&gt;</span>
    <span style="color:#204a87;font-weight:bold">&lt;/execution&gt;</span>
  <span style="color:#204a87;font-weight:bold">&lt;/executions&gt;</span>
<span style="color:#204a87;font-weight:bold">&lt;/plugin&gt;</span></code></pre></div>
<p>这样打出的java jar包会将依赖的包一并打入jar包中。</p>

<p><strong>启动jmeter GUI界面</strong></p>

<p>jmeter的测试计划是必须得在界面上面创建的，所以首先在我的系统中启动jmeter的gui界面。</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">bin % ls -1
ApacheJMeter.jar
BeanShellAssertion.bshrc
BeanShellFunction.bshrc
BeanShellListeners.bshrc
BeanShellSampler.bshrc
create-rmi-keystore.bat
create-rmi-keystore.sh
examples
hc.parameters
heapdump.cmd
heapdump.sh
jaas.conf
jmeter
jmeter-n-r.cmd
jmeter-n.cmd
jmeter-server
jmeter-server.bat
jmeter-server.log
jmeter-t.cmd
jmeter.bat
jmeter.log
jmeter.properties
jmeter.sh
jmeterw.cmd
krb5.conf
log4j2.xml
mirror-server
mirror-server.cmd
mirror-server.sh
report-template
reportgenerator.properties
saveservice.properties
shutdown.cmd
shutdown.sh
stoptest.cmd
stoptest.sh
system.properties
templates
threaddump.cmd
threaddump.sh
upgrade.properties
user.properties
utility.groovy

<span style="color:#8f5902;font-style:italic">## 在MAC中启动jmeter的GUI</span>
bin % ./jmeter
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in <span style="color:#ce5c00;font-weight:bold">[</span>jar:file:/Users/domino/Downloads/apache-jmeter-5.5/lib/log4j-slf4j-impl-2.17.2.jar!/org/slf4j/impl/StaticLoggerBinder.class<span style="color:#ce5c00;font-weight:bold">]</span>
SLF4J: Found binding in <span style="color:#ce5c00;font-weight:bold">[</span>jar:file:/Users/domino/Downloads/apache-jmeter-5.5/lib/ext/gcache-jmeter-demo-0.0.1-SNAPSHOT-jar-with-dependencies.jar!/org/slf4j/impl/StaticLoggerBinder.class<span style="color:#ce5c00;font-weight:bold">]</span>
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings <span style="color:#204a87;font-weight:bold">for</span> an explanation.
SLF4J: Actual binding is of <span style="color:#204a87">type</span> <span style="color:#ce5c00;font-weight:bold">[</span>org.apache.logging.slf4j.Log4jLoggerFactory<span style="color:#ce5c00;font-weight:bold">]</span>
<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span>
Don<span style="color:#a40000">&#39;</span>t use GUI mode <span style="color:#204a87;font-weight:bold">for</span> load testing !, only <span style="color:#204a87;font-weight:bold">for</span> Test creation and Test debugging.
For load testing, use CLI Mode <span style="color:#ce5c00;font-weight:bold">(</span>was NON GUI<span style="color:#ce5c00;font-weight:bold">)</span>:
   jmeter -n -t <span style="color:#ce5c00;font-weight:bold">[</span>jmx file<span style="color:#ce5c00;font-weight:bold">]</span> -l <span style="color:#ce5c00;font-weight:bold">[</span>results file<span style="color:#ce5c00;font-weight:bold">]</span> -e -o <span style="color:#ce5c00;font-weight:bold">[</span>Path to web report folder<span style="color:#ce5c00;font-weight:bold">]</span>
<span style="color:#000;font-weight:bold">&amp;</span> increase Java Heap to meet your <span style="color:#204a87">test</span> requirements:
   Modify current env variable <span style="color:#000">HEAP</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">&#34;-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m&#34;</span> in the jmeter batch file
Check : https://jmeter.apache.org/usermanual/best-practices.html
<span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#ce5c00;font-weight:bold">=</span></code></pre></div>
<p><strong>启动JMeter GUI</strong></p>

<div  align="center"><img src="https://wejack639.oss-cn-beijing.aliyuncs.com/blogimages/img/20220822154507.png" width = 600 /> </div>

<p><strong>新增线程组</strong></p>

<div  align="center"><img src="https://wejack639.oss-cn-beijing.aliyuncs.com/blogimages/img/20220822143238.png" width = 600 /> </div>

<p><strong>配置线程组配置</strong></p>

<div  align="center"><img src="https://wejack639.oss-cn-beijing.aliyuncs.com/blogimages/img/20220822154845.png" width = 900 /> </div>

<ul>
<li><code>Number of Threads</code>:线程数，即并发数，每个线程可以代表一个用户。</li>
<li><code>Ramp-Up Period (in seconds)</code>:多长时间内初始化完这些线程。单位是秒。</li>
<li><code>Loop Count</code>:循环次数。如果要永远循环，刚勾上Infinite（永远）这个单选框，取消勾选并填写循环次数。</li>
</ul>

<p><strong>新增java测试请求案例</strong></p>

<div  align="center"><img src="https://wejack639.oss-cn-beijing.aliyuncs.com/blogimages/img/20220822154714.png" width = 900 /> </div>

<p>在测试安全中配置需要执行测试的java类</p>

<div  align="center"><img src="https://wejack639.oss-cn-beijing.aliyuncs.com/blogimages/img/20220822155834.png" width = 900 /> </div>

<p>保存配置到jmx文件中，有了这个jmx配置文件，就可以拿到linux服务上进行测试了。</p>

<h2 id="三-运行jmeter压力测试">三、运行jmeter压力测试</h2>

<p>将刚刚创建的jmeter的jmx配置文件拷贝到linux服务的jmeter目录下，再将java代码jar包拷贝到linux服务器的 jmeter目录的lib/ext目录下。</p>

<p><strong>启动jmeter测试服务</strong></p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#ce5c00;font-weight:bold">[</span>root@migrate_7_59 bin<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># sh /app/cachecloud/jmeter/bin/jmeter-server</span></code></pre></div>
<p><strong>运行压力测试</strong></p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#ce5c00;font-weight:bold">[</span>root@migrate_7_59 bin<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># sh /app/cachecloud/jmeter/bin/jmeter.sh -n -t /app/cachecloud/jmeter/gcache-test.jmx  -r -e -o /app/cachecloud/jmeter/result/result4 -l /app/cachecloud/jmeter/result/result4/gcache-test.jtl</span>
<span style="color:#000">summary</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#0000cf;font-weight:bold">6384438</span> in 01:40:40 <span style="color:#ce5c00;font-weight:bold">=</span> 1057.0/s Avg:     <span style="color:#0000cf;font-weight:bold">0</span> Min:     <span style="color:#0000cf;font-weight:bold">0</span> Max:     <span style="color:#0000cf;font-weight:bold">0</span> Err: <span style="color:#0000cf;font-weight:bold">1598327</span> <span style="color:#ce5c00;font-weight:bold">(</span>25.03%<span style="color:#ce5c00;font-weight:bold">)</span>
summary +  <span style="color:#0000cf;font-weight:bold">54100</span> in 00:00:30 <span style="color:#ce5c00;font-weight:bold">=</span> 1803.5/s Avg:     <span style="color:#0000cf;font-weight:bold">0</span> Min:     <span style="color:#0000cf;font-weight:bold">0</span> Max:     <span style="color:#0000cf;font-weight:bold">0</span> Err:  <span style="color:#0000cf;font-weight:bold">1065</span> <span style="color:#ce5c00;font-weight:bold">(</span>1.97%<span style="color:#ce5c00;font-weight:bold">)</span> Active: -72 Started: <span style="color:#0000cf;font-weight:bold">215</span> Finished: <span style="color:#0000cf;font-weight:bold">287</span>
<span style="color:#000">summary</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#0000cf;font-weight:bold">6438538</span> in 01:41:10 <span style="color:#ce5c00;font-weight:bold">=</span> 1060.7/s Avg:     <span style="color:#0000cf;font-weight:bold">0</span> Min:     <span style="color:#0000cf;font-weight:bold">0</span> Max:     <span style="color:#0000cf;font-weight:bold">0</span> Err: <span style="color:#0000cf;font-weight:bold">1599392</span> <span style="color:#ce5c00;font-weight:bold">(</span>24.84%<span style="color:#ce5c00;font-weight:bold">)</span>
summary +  <span style="color:#0000cf;font-weight:bold">45028</span> in 00:00:31 <span style="color:#ce5c00;font-weight:bold">=</span> 1431.6/s Avg:     <span style="color:#0000cf;font-weight:bold">0</span> Min:     <span style="color:#0000cf;font-weight:bold">0</span> Max:     <span style="color:#0000cf;font-weight:bold">0</span> Err:  <span style="color:#0000cf;font-weight:bold">5110</span> <span style="color:#ce5c00;font-weight:bold">(</span>11.35%<span style="color:#ce5c00;font-weight:bold">)</span> Active: -94 Started: <span style="color:#0000cf;font-weight:bold">215</span> Finished: <span style="color:#0000cf;font-weight:bold">309</span>
<span style="color:#000">summary</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#0000cf;font-weight:bold">6483566</span> in 01:41:42 <span style="color:#ce5c00;font-weight:bold">=</span> 1062.6/s Avg:     <span style="color:#0000cf;font-weight:bold">0</span> Min:     <span style="color:#0000cf;font-weight:bold">0</span> Max:     <span style="color:#0000cf;font-weight:bold">0</span> Err: <span style="color:#0000cf;font-weight:bold">1604502</span> <span style="color:#ce5c00;font-weight:bold">(</span>24.75%<span style="color:#ce5c00;font-weight:bold">)</span>
summary +  <span style="color:#0000cf;font-weight:bold">66072</span> in 00:00:29 <span style="color:#ce5c00;font-weight:bold">=</span> 2317.4/s Avg:     <span style="color:#0000cf;font-weight:bold">0</span> Min:     <span style="color:#0000cf;font-weight:bold">0</span> Max:     <span style="color:#0000cf;font-weight:bold">0</span> Err: <span style="color:#0000cf;font-weight:bold">16097</span> <span style="color:#ce5c00;font-weight:bold">(</span>24.36%<span style="color:#ce5c00;font-weight:bold">)</span> Active: -124 Started: <span style="color:#0000cf;font-weight:bold">215</span> Finished: <span style="color:#0000cf;font-weight:bold">339</span>
<span style="color:#000">summary</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#0000cf;font-weight:bold">6549638</span> in 01:42:10 <span style="color:#ce5c00;font-weight:bold">=</span> 1068.4/s Avg:     <span style="color:#0000cf;font-weight:bold">0</span> Min:     <span style="color:#0000cf;font-weight:bold">0</span> Max:     <span style="color:#0000cf;font-weight:bold">0</span> Err: <span style="color:#0000cf;font-weight:bold">1620599</span> <span style="color:#ce5c00;font-weight:bold">(</span>24.74%<span style="color:#ce5c00;font-weight:bold">)</span>
summary +  <span style="color:#0000cf;font-weight:bold">48153</span> in 00:00:30 <span style="color:#ce5c00;font-weight:bold">=</span> 1583.4/s Avg:     <span style="color:#0000cf;font-weight:bold">0</span> Min:     <span style="color:#0000cf;font-weight:bold">0</span> Max:     <span style="color:#0000cf;font-weight:bold">0</span> Err: <span style="color:#0000cf;font-weight:bold">12524</span> <span style="color:#ce5c00;font-weight:bold">(</span>26.01%<span style="color:#ce5c00;font-weight:bold">)</span> Active: -150 Started: <span style="color:#0000cf;font-weight:bold">215</span> Finished: <span style="color:#0000cf;font-weight:bold">365</span>
<span style="color:#000">summary</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#0000cf;font-weight:bold">6597791</span> in 01:42:41 <span style="color:#ce5c00;font-weight:bold">=</span> 1071.0/s Avg:     <span style="color:#0000cf;font-weight:bold">0</span> Min:     <span style="color:#0000cf;font-weight:bold">0</span> Max:     <span style="color:#0000cf;font-weight:bold">0</span> Err: <span style="color:#0000cf;font-weight:bold">1633123</span> <span style="color:#ce5c00;font-weight:bold">(</span>24.75%<span style="color:#ce5c00;font-weight:bold">)</span>
summary +  <span style="color:#0000cf;font-weight:bold">67147</span> in 00:00:30 <span style="color:#ce5c00;font-weight:bold">=</span> 2242.0/s Avg:     <span style="color:#0000cf;font-weight:bold">0</span> Min:     <span style="color:#0000cf;font-weight:bold">0</span> Max:     <span style="color:#0000cf;font-weight:bold">0</span> Err: <span style="color:#0000cf;font-weight:bold">19554</span> <span style="color:#ce5c00;font-weight:bold">(</span>29.12%<span style="color:#ce5c00;font-weight:bold">)</span> Active: -190 Started: <span style="color:#0000cf;font-weight:bold">215</span> Finished: <span style="color:#0000cf;font-weight:bold">405</span>
<span style="color:#000">summary</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#0000cf;font-weight:bold">6664938</span> in 01:43:11 <span style="color:#ce5c00;font-weight:bold">=</span> 1076.6/s Avg:     <span style="color:#0000cf;font-weight:bold">0</span> Min:     <span style="color:#0000cf;font-weight:bold">0</span> Max:     <span style="color:#0000cf;font-weight:bold">0</span> Err: <span style="color:#0000cf;font-weight:bold">1652677</span> <span style="color:#ce5c00;font-weight:bold">(</span>24.80%<span style="color:#ce5c00;font-weight:bold">)</span>
summary +  <span style="color:#0000cf;font-weight:bold">53262</span> in 00:00:26 <span style="color:#ce5c00;font-weight:bold">=</span> 2015.5/s Avg:     <span style="color:#0000cf;font-weight:bold">0</span> Min:     <span style="color:#0000cf;font-weight:bold">0</span> Max:     <span style="color:#0000cf;font-weight:bold">0</span> Err:  <span style="color:#0000cf;font-weight:bold">6029</span> <span style="color:#ce5c00;font-weight:bold">(</span>11.32%<span style="color:#ce5c00;font-weight:bold">)</span> Active: -249 Started: <span style="color:#0000cf;font-weight:bold">215</span> Finished: <span style="color:#0000cf;font-weight:bold">464</span>
<span style="color:#000">summary</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#0000cf;font-weight:bold">6718200</span> in 01:43:37 <span style="color:#ce5c00;font-weight:bold">=</span> 1080.6/s Avg:     <span style="color:#0000cf;font-weight:bold">0</span> Min:     <span style="color:#0000cf;font-weight:bold">0</span> Max:     <span style="color:#0000cf;font-weight:bold">0</span> Err: <span style="color:#0000cf;font-weight:bold">1658706</span> <span style="color:#ce5c00;font-weight:bold">(</span>24.69%<span style="color:#ce5c00;font-weight:bold">)</span>
Tidying up remote @ August 22, <span style="color:#0000cf;font-weight:bold">2022</span> 1:50:26 PM CST <span style="color:#ce5c00;font-weight:bold">(</span>1661147426865<span style="color:#ce5c00;font-weight:bold">)</span>
... end of run</code></pre></div>
<p>jmeter运行参数如下：</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-text" data-lang="text">-n 表示使用non-gui模式
-t [JMX测试脚本的名称].
-l [保存JTL 测试结果文件的路径].
-j [JMeter log文件的路径].
-r 在JMeter的远程机器上运行测试，远程机器由 property &#34; remote_hosts &#34;指定
-R [远程机器列表] 在指定的远程机器上运行测试
-g [CSV 文件路径] 通过csv文件来创建dashboard报告
-e 运行结束后创建dashboard报告
-o 在哪个目录创建dashboard报告，该目录必须为空或者不存在</code></pre></div>
<p>这里注意，<code>-o</code>参数指定的目录必须是空目录，否则会报错误。</p>

<p>压力测试运行完以后，会在指定的目录中产生测试报告。</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#ce5c00;font-weight:bold">[</span>root@migrate_7_59 result4<span style="color:#ce5c00;font-weight:bold">]</span><span style="color:#8f5902;font-style:italic"># ls -1</span>
content
gcache-test.jtl
index.html
sbadmin2-1.0.7
statistics.json</code></pre></div>
<div  align="center"><img src="https://wejack639.oss-cn-beijing.aliyuncs.com/blogimages/img/20220822163726.png" width = 900 /> </div>

    </div>
    <footer class="post-footer">
     
 
<div class="post-tags">     
     
    <a href="http://www.shutdown.cn/tags/jmeter" rel="tag" title="jmeter">#jmeter#</a>
    
    <a href="http://www.shutdown.cn/tags/linux" rel="tag" title="linux">#linux#</a>
    
    <a href="http://www.shutdown.cn/tags/java" rel="tag" title="java">#java#</a>
    
    <a href="http://www.shutdown.cn/tags/%e5%8e%8b%e5%8a%9b%e6%b5%8b%e8%af%95" rel="tag" title="压力测试">#压力测试#</a>
    
</div>



     <div class="post-nav">
    <div class="post-nav-next post-nav-item">
    
        <a href="http://www.shutdown.cn/post/what-is-qps-and-what-is-tps/" rel="next" title="QPS、TPS是什么">
        <i class="fa fa-chevron-left"></i> QPS、TPS是什么
        </a>
    
    </div>

    <div class="post-nav-prev post-nav-item">
    
        <a href="http://www.shutdown.cn/post/maven-packages-third-party-jar-packages-together-into-the-project-jar-package/" rel="prev" title="maven将第三方jar包一起打包到项目 jar 包中">
        maven将第三方jar包一起打包到项目 jar 包中 <i class="fa fa-chevron-right"></i>
        </a>
    
    </div>
</div>
      
     
     
     






    </footer>
  </article>
</section>

          </div>
        </div>
        <div class="sidebar-toggle">
  <div class="sidebar-toggle-line-wrap">
    <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
    <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
    <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
  </div>
</div>
<aside id="sidebar" class="sidebar">
  <div class="sidebar-inner">

  <ul class="sidebar-nav motion-element">
    <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
      文章目录
    </li>
    <li class="sidebar-nav-overview" data-target="site-overview">
      站点概览
    </li>
  </ul>

    <section class="site-overview sidebar-panel ">
      <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image"
        src="http://www.shutdown.cn/img/author.jpg"
        alt="不与天斗Domino" />
    <p class="site-author-name" itemprop="name">不与天斗Domino</p>
    <p class="site-description motion-element" itemprop="description"> 
        Programmer &amp; Architect</p>
</div>
      <nav class="site-state motion-element">
    <div class="site-state-item site-state-posts">
      <a href="http://www.shutdown.cn/post/">
        <span class="site-state-item-count">183</span>
        <span class="site-state-item-name">日志</span>
      </a>
    </div>
    <div class="site-state-item site-state-categories">    
        <a href="http://www.shutdown.cn/categories/">      
         
        <span class="site-state-item-count">15</span>
        
        <span class="site-state-item-name">分类</span>
        
        </a>
    </div>

    <div class="site-state-item site-state-tags">
        <a href="http://www.shutdown.cn/tags/">
         
        <span class="site-state-item-count">224</span>
        
        <span class="site-state-item-name">标签</span>
        </a>
    </div>
</nav>
      
      

      

      <div class="links-of-blogroll motion-element inline">
<script type="text/javascript" src="//rf.revolvermaps.com/0/0/8.js?i=&amp;m=0&amp;s=220&amp;c=ff0000&amp;cr1=ffffff&amp;f=arial&amp;l=33&amp;bv=35" async="async"></script>
</div>

    </section>
    
<section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
    <div class="post-toc">
        <div class="post-toc-content"><nav id="TableOfContents">
<ul>
<li>
<ul>
<li><a href="#一-环境准备">一、环境准备</a></li>
<li><a href="#二-创建jmeter测试计划">二、创建jmeter测试计划</a></li>
<li><a href="#三-运行jmeter压力测试">三、运行jmeter压力测试</a></li>
</ul></li>
</ul>
</nav></div>
    </div>
</section>

  </div>
</aside>

      </div>
    </main>
   
    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  <span itemprop="copyrightYear">  &copy; 
  2013 - 2023</span>
  <span class="with-love"><i class="fa fa-heart"></i></span>
  <span class="author" itemprop="copyrightHolder">天地维杰网</span>
  <span class="icp" itemprop="copyrightHolder"><a href="https://beian.miit.gov.cn/" target="_blank">京ICP备13019191号-1</a></span>
</div>
<div class="powered-by">
  Powered by - <a class="theme-link" href="http://gohugo.io" target="_blank" title="hugo" >Hugo v0.63.2</a>
</div>
<div class="theme-info">
  Theme by - <a class="theme-link" href="https://github.com/xtfly/hugo-theme-next" target="_blank"> NexT
  </a>
</div>


      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
      <span id="scrollpercent"><span>0</span>%</span>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/jquery/index.js?v=2.1.3"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/fastclick/lib/fastclick.min.js?v=1.0.6"></script> 
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/velocity/velocity.min.js?v=1.2.1"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/velocity/velocity.ui.min.js?v=1.2.1"></script>
<script src="http://www.shutdown.cn/js/vendor/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>

<script src="http://www.shutdown.cn/js/vendor/fancybox/jquery.fancybox.pack.js?v=2.1.5"></script>

<script type="text/javascript" src="http://www.shutdown.cn/js/utils.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/motion.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/affix.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/schemes/pisces.js"></script>

<script type="text/javascript" src="http://www.shutdown.cn/js/scrollspy.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/post-details.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/toc.js"></script>

<script type="text/javascript" src="http://www.shutdown.cn/js/bootstrap.js"></script>

<script type="text/javascript" src="http://www.shutdown.cn/js/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX", "output/HTML-CSS"],
    tex2jax: {
      inlineMath: [ ['$','$'] ],
      displayMath: [ ['$$','$$'] ],
      processEscapes: true
    },
    "HTML-CSS": { fonts: ["TeX"] }
  });
</script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML' async></script>
</body>
</html>